package com.liusr.template.controller;

import com.liusr.template.mq.producer.NotifyMsgProducer;
import com.liusr.template.vo.NotifyMsgSendVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.UUID;

/**
 * @author Liusr
 * @date 2023/3/14
 * @package com.liusr.template.controller
 * @Description: mq controller test
 */
@RestController
public class TestMqController {

	@Resource
	private NotifyMsgProducer notifyMsgProducer;

	@GetMapping("/produce")
	public String produce() {
		NotifyMsgSendVO vo = new NotifyMsgSendVO();
		vo.setPriKey(UUID.randomUUID().toString());
		vo.setPhoneNum("13623654587");
		vo.setBusinessType("msg_send");
		vo.setMsg("hello world");
		notifyMsgProducer.send(vo);
		return "success";
	}
}
